import Qt 4.7
import "scripts.js" as Game

Rectangle {
    id: rectangle1
    width: 360
    height: 640

    Image {
        id: image1
        x: 0
        y: 0
        width: parent.width
        height: parent.height
        source: "images/start.jpg"
    }

    Item {
        id: navigation
        x: 32
        y: 306
        width: parent.width *0.9;
        height: 266
        anchors.horizontalCenter: parent.horizontalCenter

        Button {
            id: button1
            x: 5
            y: 2
            buttonText: "New Game"
            width: parent.width
            height: 50

            onButtonClicked : {
                Game.newGame()
            }
        }

        Button {
            id: button2
            buttonText : "Highscores"
            x: 5
            y: 62
            width: parent.width
            height: 50

            onButtonClicked: {
                Game.getScores();
                Game.setState("highscore")
            }
        }

        Button {
            id: button3
            buttonText: "Help"
            x: 5
            y: 182
            width: parent.width / 2 -25
            height: 50
            anchors.left: parent.left
            anchors.leftMargin: 5

            onButtonClicked: gameArea.state = "info"

        }

        Button {
            id: button4
            buttonText: "Exit"
            x: 233
            y: 181
            width: parent.width / 2 -25
            height: 50
            anchors.right: parent.right
            anchors.rightMargin: 0

            onButtonClicked: {
                appData.close();
            }
        }

        Button {
            id: button5
            x: 5
            y: 122
            height: 50
            opacity: 0.67
            buttonText: "More Games"
            width: parent.width

            onButtonClicked: {
                Qt.openUrlExternally("http://store.ovi.com/publisher/jiikoo")
            }
        }
    }
}
